﻿using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace TigerController.Comparison
{
    public class ColorOfSpecificJoint
    {
        private readonly JointType m_specificJointType;
        private readonly Color m_color;
        public JointType SpecificJointType { get { return m_specificJointType; } }
        public Color Color { get { return m_color; } }
        public ColorOfSpecificJoint(ScoreOfSpecificJoint scoreOfSpecificJoint)
        {
            m_specificJointType = scoreOfSpecificJoint.SpecificJointType;
            if (scoreOfSpecificJoint.Score >= 70)
            {
                m_color = Colors.Green;
            }
            else if (scoreOfSpecificJoint.Score < 70
                &&
                scoreOfSpecificJoint.Score >= 30)
            {
                m_color = Colors.Yellow;
            }
            else
            {
                m_color = Colors.Red;
            }
        }
        public static implicit operator ColorOfSpecificJoint(
            ScoreOfSpecificJoint scoreOfSpecificJoint)
        {
            return new ColorOfSpecificJoint(scoreOfSpecificJoint);
        }
    }
}
